<?php
session_start();

if(!isset($_SESSION['id'])){
	header('Location:login.php');
}
 $id=$_POST['id'];
/* $connection=mysql_connect("localhost","root","");
 mysql_select_db("shenji",$connection);
 mysql_query("set names utf8");
 $sql="select * from jiekou where id=$id";
 $result=mysql_query($sql);
 $row=mysql_fetch_array($result);
 echo json_encode($row);*/
$db=new PDO("mysql:host=localhost;dbname=shenji","root","");
$db->query("set names utf8");
$sql="select * from jiekou where id=?";
$result=$db->prepare($sql);
$exeres=$result->execute(array($id));
if($exeres){
	$row=$result->fetch(PDO::FETCH_ASSOC);
}
echo json_encode($row);
?>